<template>
  <div style="height: 100vh">
    <el-menu
        style="height: 100vh"
        router
        background-color="#bd5d38"
        active-text-color="#ffd04b"
        text-color="#fff"
        default-active="2"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
    >
      <el-menu-item index="user" v-if="isAuth()">
        <el-icon><User /></el-icon>
        <span>用户管理</span>
      </el-menu-item>
      <el-sub-menu index="goods_category">
        <template #title>
          <el-icon><Goods /></el-icon>
          <span>货物管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="goods">货物操作</el-menu-item>
          <el-menu-item index="category" v-if="isAuth()">分类操作</el-menu-item>
        </el-menu-item-group>
      </el-sub-menu>
      <el-menu-item index="car" v-if="isAuth()||isDriver()">
        <el-icon><Shop /></el-icon>
        <span>车辆管理</span>
      </el-menu-item>
      <el-menu-item index="order">
        <el-icon><ShoppingCart /></el-icon>
        <span>订单管理</span>
      </el-menu-item>
      <el-menu-item index="chat">
        <el-icon><Connection /></el-icon>
        <span>交流板块</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>
<script setup>
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
import {isAuth, isDriver, isGoodsOwner} from "@/utils/common";
const handleOpen = (key, keyPath) => {
  console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}

</script>

<style scoped>
</style>